package com.rookie.im.learn.io.mq.consumer.direct;

import com.rookie.im.learn.io.mq.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queues = RabbitMQConfig.RABBITMQ_DEMO_TOPIC)
public class ConsumerService {
    @RabbitHandler
    public void process(Map<String, Object> map) {
        System.out.println("收到消息: " + map);
    }
}
